﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.DirectoryServices;
using Infinitus.Mail.Utilities.Helper;
using Infinitus.Mail.Core.Configuration;

namespace Infinitus.Mail.Utilities.Helper
{
    public class ADService
    {

        private static DCHelper _rootDCHelper;
        //private static DCHelper _rootGroupDCHelper;

        private static AdClientConfiguration config;
        public static AdClientConfiguration Config
        {
            get { return config; }
        }

        static ADService()
        {
            config = AdClientConfiguration.Config;

            _rootDCHelper = new DCHelper(config.DcFQDN, config.Domain, config.LoginName, config.Password, new string[] { config.DepartmentRootOUPath });
            //_rootGroupDCHelper = new DCHelper(config.DcFQDN, config.Domain, config.LoginName, config.Password, new string[] { config.GroupRootOUPath });
        }

        public static DCHelper DCHelper
        {
            get { return _rootDCHelper; }
        }

        //public static DCHelper GroupDCHelper
        //{
        //    get { return _rootGroupDCHelper; }
        //}




    }
}
